<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>1.多选题 下面说法正确的是？（选择两项） |  zfy的个人博客</title>
    <meta name="generator" content="VuePress 1.9.7">
    <link rel="icon" href="./img/Scorpio.png">
    <link rel="stylesheet" href="./css/style.css">
    <meta name="description" content="My tech blog">
    
    <link rel="preload" href="./assets/css/0.styles.cfdaa54c.css" as="style"><link rel="preload" href="./assets/js/app.7878252f.js" as="script"><link rel="preload" href="./assets/js/2.877879cc.js" as="script"><link rel="preload" href="./assets/js/85.96bc7e77.js" as="script"><link rel="prefetch" href="./assets/js/10.a489e96f.js"><link rel="prefetch" href="./assets/js/11.f6f26a2f.js"><link rel="prefetch" href="./assets/js/12.8a827e29.js"><link rel="prefetch" href="./assets/js/13.e420b04a.js"><link rel="prefetch" href="./assets/js/14.52f00cc6.js"><link rel="prefetch" href="./assets/js/15.ef68d553.js"><link rel="prefetch" href="./assets/js/16.c2999dfd.js"><link rel="prefetch" href="./assets/js/17.0adb748c.js"><link rel="prefetch" href="./assets/js/18.2c077020.js"><link rel="prefetch" href="./assets/js/19.013b5e02.js"><link rel="prefetch" href="./assets/js/20.bb3b854e.js"><link rel="prefetch" href="./assets/js/21.28efc78c.js"><link rel="prefetch" href="./assets/js/22.4a1d71dd.js"><link rel="prefetch" href="./assets/js/23.605a5451.js"><link rel="prefetch" href="./assets/js/24.66bf035d.js"><link rel="prefetch" href="./assets/js/25.fbe72655.js"><link rel="prefetch" href="./assets/js/26.3f374d1f.js"><link rel="prefetch" href="./assets/js/27.556ea617.js"><link rel="prefetch" href="./assets/js/28.0cab868b.js"><link rel="prefetch" href="./assets/js/29.564f8747.js"><link rel="prefetch" href="./assets/js/3.4cfb1b9c.js"><link rel="prefetch" href="./assets/js/30.c4a099d1.js"><link rel="prefetch" href="./assets/js/31.7fbc3d2a.js"><link rel="prefetch" href="./assets/js/32.8f356b20.js"><link rel="prefetch" href="./assets/js/33.b5a1b0bb.js"><link rel="prefetch" href="./assets/js/34.57086c2e.js"><link rel="prefetch" href="./assets/js/35.2b4d0231.js"><link rel="prefetch" href="./assets/js/36.a99f6d64.js"><link rel="prefetch" href="./assets/js/37.eb25dcef.js"><link rel="prefetch" href="./assets/js/38.e45d8594.js"><link rel="prefetch" href="./assets/js/39.213e3a72.js"><link rel="prefetch" href="./assets/js/4.b86a0fbe.js"><link rel="prefetch" href="./assets/js/40.cadafdd6.js"><link rel="prefetch" href="./assets/js/41.23b0f26d.js"><link rel="prefetch" href="./assets/js/42.7c2b83c6.js"><link rel="prefetch" href="./assets/js/43.62f328ea.js"><link rel="prefetch" href="./assets/js/44.c4dfbd34.js"><link rel="prefetch" href="./assets/js/45.cde5bb22.js"><link rel="prefetch" href="./assets/js/46.6c62bdb8.js"><link rel="prefetch" href="./assets/js/47.4857766a.js"><link rel="prefetch" href="./assets/js/48.55a0cccc.js"><link rel="prefetch" href="./assets/js/49.3dceda91.js"><link rel="prefetch" href="./assets/js/5.13776f82.js"><link rel="prefetch" href="./assets/js/50.ab4d52fa.js"><link rel="prefetch" href="./assets/js/51.69ccc35a.js"><link rel="prefetch" href="./assets/js/52.01f3f711.js"><link rel="prefetch" href="./assets/js/53.c146a1ff.js"><link rel="prefetch" href="./assets/js/54.71ce70c2.js"><link rel="prefetch" href="./assets/js/55.98ef481d.js"><link rel="prefetch" href="./assets/js/56.b23daa51.js"><link rel="prefetch" href="./assets/js/57.6aa314ad.js"><link rel="prefetch" href="./assets/js/58.7d6367d9.js"><link rel="prefetch" href="./assets/js/59.88894cf5.js"><link rel="prefetch" href="./assets/js/6.93d89692.js"><link rel="prefetch" href="./assets/js/60.111f9a04.js"><link rel="prefetch" href="./assets/js/61.add82aab.js"><link rel="prefetch" href="./assets/js/62.8bfac830.js"><link rel="prefetch" href="./assets/js/63.db44a5ca.js"><link rel="prefetch" href="./assets/js/64.0244f0ef.js"><link rel="prefetch" href="./assets/js/65.2be994de.js"><link rel="prefetch" href="./assets/js/66.c5066e37.js"><link rel="prefetch" href="./assets/js/67.c11b474b.js"><link rel="prefetch" href="./assets/js/68.276bdc3e.js"><link rel="prefetch" href="./assets/js/69.f5f39d50.js"><link rel="prefetch" href="./assets/js/7.ca9f7e96.js"><link rel="prefetch" href="./assets/js/70.e3ca02b0.js"><link rel="prefetch" href="./assets/js/71.befcf8f7.js"><link rel="prefetch" href="./assets/js/72.04fabafd.js"><link rel="prefetch" href="./assets/js/73.e5b707f2.js"><link rel="prefetch" href="./assets/js/74.b5668150.js"><link rel="prefetch" href="./assets/js/75.eb7cfac9.js"><link rel="prefetch" href="./assets/js/76.c1b76370.js"><link rel="prefetch" href="./assets/js/77.5875e953.js"><link rel="prefetch" href="./assets/js/78.a5e2fa5b.js"><link rel="prefetch" href="./assets/js/79.eb2d51a7.js"><link rel="prefetch" href="./assets/js/8.570c39ea.js"><link rel="prefetch" href="./assets/js/80.7252ac50.js"><link rel="prefetch" href="./assets/js/81.eb980d26.js"><link rel="prefetch" href="./assets/js/82.9e069d8f.js"><link rel="prefetch" href="./assets/js/83.8c5a6dc6.js"><link rel="prefetch" href="./assets/js/84.26baaa09.js"><link rel="prefetch" href="./assets/js/86.9c9dd1ca.js"><link rel="prefetch" href="./assets/js/87.d54639b8.js"><link rel="prefetch" href="./assets/js/88.3d3ae1e1.js"><link rel="prefetch" href="./assets/js/89.a81caa83.js"><link rel="prefetch" href="./assets/js/9.7a58df3d.js"><link rel="prefetch" href="./assets/js/90.c3c347ed.js"><link rel="prefetch" href="./assets/js/91.b6240032.js"><link rel="prefetch" href="./assets/js/92.8331718a.js"><link rel="prefetch" href="./assets/js/93.ca174cfa.js"><link rel="prefetch" href="./assets/js/94.fec3300c.js"><link rel="prefetch" href="./assets/js/95.076b06fb.js"><link rel="prefetch" href="./assets/js/96.8ed8b32f.js">
    <link rel="stylesheet" href="./assets/css/0.styles.cfdaa54c.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/./" class="home-link router-link-active"><!----> <span class="site-name"> zfy的个人博客</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="http://127.0.0.1:3002/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  自由博客板块
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="http://zfyangelo.gitee.io/yu-weather-web-show/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  天气预报
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="/./guide/" class="nav-link router-link-active">
  个人的学习笔记
</a></div><div class="nav-item"><a href="/./baodian/interview/" class="nav-link">
  项目及在校经历
</a></div><div class="nav-item"><a href="/./baodian/talk/" class="nav-link">
  爱好和联系方式
</a></div><div class="nav-item"><a href="https://gitee.com/zfyangelo" target="_blank" rel="noopener noreferrer" class="nav-link external">
  我的gitee
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="http://127.0.0.1:3002/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  自由博客板块
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="http://zfyangelo.gitee.io/yu-weather-web-show/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  天气预报
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="/./guide/" class="nav-link router-link-active">
  个人的学习笔记
</a></div><div class="nav-item"><a href="/./baodian/interview/" class="nav-link">
  项目及在校经历
</a></div><div class="nav-item"><a href="/./baodian/talk/" class="nav-link">
  爱好和联系方式
</a></div><div class="nav-item"><a href="https://gitee.com/zfyangelo" target="_blank" rel="noopener noreferrer" class="nav-link external">
  我的gitee
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>HTML</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>CSS</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Javascipt</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>HTML&amp;CSS练习</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>Javascipt练习</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/./guide/notes/jswork/01-认识javascript.html" class="sidebar-link">01-认识javaScript</a></li><li><a href="/./guide/notes/jswork/02-变量与数据类型.html" class="sidebar-link">02-变量与数据类型</a></li><li><a href="/./guide/notes/jswork/03-DOM.html" class="sidebar-link">03-DOM</a></li><li><a href="/./guide/notes/jswork/04-表达式和操作符.html" class="sidebar-link">04-表达式和操作符</a></li><li><a href="/./guide/notes/jswork/05-判断.html" class="sidebar-link">05-判断</a></li><li><a href="/./guide/notes/jswork/06-循环.html" class="sidebar-link">06-循环</a></li><li><section class="sidebar-group collapsable is-sub-group depth-1"><p class="sidebar-heading"><span>07-暂无</span> <span class="arrow right"></span></p> <!----></section></li><li><a href="/./guide/notes/jswork/08-函数.html" class="sidebar-link">08-函数</a></li><li><a href="/./guide/notes/jswork/09-案例.html" class="sidebar-link">09-案例</a></li><li><a href="/./guide/notes/jswork/10-数组.html" class="sidebar-link">10-数组</a></li><li><a href="/./guide/notes/jswork/11-字符串.html" class="sidebar-link">11-字符串</a></li><li><a href="/./guide/notes/jswork/12-DOM.html" class="sidebar-link">12-DOM</a></li><li><a href="/./guide/notes/jswork/13-浏览器操作.html" class="sidebar-link">13-BOM</a></li><li><a href="/./guide/notes/jswork/14-面向project.html" class="sidebar-link">14-面向对象</a></li><li><a href="/./guide/notes/jswork/15-Js阶段测试组卷.html" class="active sidebar-link">15-Js阶段测试组卷</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/./guide/notes/jswork/16-模板字符串箭头函数变量声明.html" class="sidebar-link">16-模板字符串箭头函数变量声明</a></li><li><a href="/./guide/notes/jswork/17-解构赋值.html" class="sidebar-link">17-解构赋值</a></li><li><a href="/./guide/notes/jswork/18-project字面量增强和函数默认参数.html" class="sidebar-link">18-对象字面量增强和函数默认参数</a></li><li><a href="/./guide/notes/jswork/19-剩余参数和数组展开.html" class="sidebar-link">19-剩余参数和数组展开</a></li><li><a href="/./guide/notes/jswork/20-Map Set.html" class="sidebar-link">20-Map Set</a></li><li><a href="/./guide/notes/jswork/21-iterator和for...of循环.html" class="sidebar-link">21-iterator和for...of循环</a></li><li><a href="/./guide/notes/jswork/22-Promise和class.html" class="sidebar-link">22-Promise和class</a></li><li><a href="/./guide/notes/jswork/23-module.html" class="sidebar-link">23-module</a></li><li><a href="/./guide/notes/jswork/24-ES6测评题目.html" class="sidebar-link">24-ES6测评题目</a></li><li><a href="/./guide/notes/jswork/25-本地存储和http.html" class="sidebar-link">25-本地存储和http</a></li><li><a href="/./guide/notes/jswork/26-ajax选择题.html" class="sidebar-link">26-ajax选择题</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h3 id="_1-多选题-下面说法正确的是-选择两项"><a href="#_1-多选题-下面说法正确的是-选择两项" class="header-anchor">#</a> 1.<strong>多选题</strong> 下面说法正确的是？（选择两项）</h3> <p>**A.**变量初次赋值时，不使用var定义，则为全局变量</p> <p>**B.**typeof null，返回的结果为null</p> <p>**C.**非零数字除以0时，结果是Infinity</p> <p>**D.**在定义变量之前，输出此变量会报错</p> <p><strong>参考解析：</strong></p> <p>本题考查变量和类型的基本概念。</p> <p>不管在全局作用域还是局部作用域，初次赋值时，如果没有使用var定义，那么变量为全局变量，A说法正确。</p> <p>typeof 是检测数据类型，typeof null输出的是object，B说法错误。</p> <p>Infinity是一个数值，表示无穷大。非零数字除以0时，结果是Infinity，C说法正确。</p> <p>在js代码执行之前，变量会预解析，即提前定义。所以会输出undefined，不会报错，D说法错误。</p> <p><strong>所以本题答案为AC。</strong></p> <h3 id="_2-多选题-已知x-4、y-5、z-0-以下选项中说法错误的是-选择两项"><a href="#_2-多选题-已知x-4、y-5、z-0-以下选项中说法错误的是-选择两项" class="header-anchor">#</a> 2. <strong>多选题</strong> : 已知x=4、y=5、z=0，以下选项中说法错误的是？（选择两项）</h3> <p>**A.**x||y||z返回结果为0</p> <p>**B.**z&amp;&amp;y&amp;&amp;x 返回结果为0</p> <p><strong>C.</strong> (y-z)%4返回结果为结果为1</p> <p><strong>D.</strong>(z++)+(--x)-y返回结果为-1</p> <p><strong>本题考查操作符和表达式。</strong></p> <p>||逻辑或中，从左往右计算，返回第一个可以转换为true的操作数。若操作数全部为false，则返回最后一个操作数。x||y||z中，第一个操作数x为4，4转换为布尔类型为true，所以结果返回4，A说法错误。</p> <p>&amp;&amp;逻辑与中，从左往右计算，返回第一个可以转换为false的操作数。若操作数全部为true，则返回最后一个操作数。x&amp;&amp;y&amp;&amp;z中，第一个操作数z为0，0转换为布尔类型为false，所以结果返回0，B说法正确。</p> <p>%为取余运算，y-z结果为5。 (y-z)%4计算的是5%4,即5除以4的余数，所以结果返回1，C说法正确。</p> <p>z++表示先参与公式的运算，再自加。--x是先自减，再参与公式运算。所以(z++)+(--x)-y计算的是0+3-5，返回的结果为-2，D说法错误。</p> <p><strong>所以本题答案为AD。</strong></p> <h3 id="_3-单选题以下代码中有几处错误-选择一项"><a href="#_3-单选题以下代码中有几处错误-选择一项" class="header-anchor">#</a> 3. <strong>单选题</strong>以下代码中有几处错误（选择一项）</h3> <p><a href="https://imgchr.com/i/BLpeje" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/11/10/BLpeje.png" alt="BLpeje.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**1</p> <p>**B.**2</p> <p><strong>C.</strong> 3</p> <p>**D.**4</p> <p><strong>本题主要考查大家排查错误的能力</strong>。</p> <p>第一处是prmopt单词拼写错误，正确拼写为prompt。</p> <p>第二处是number &lt;= 80判断逻辑错误，成绩不错应该是大于等于80，而不是小于等于80，所以要把&lt;=改成&gt;=。</p> <p>第三处是else(number &lt; 60) 语法错误，如果else后面有判断条件，那么需要使用else if。</p> <p>所以一共有3处错误，<strong>本题正确答案为C。</strong></p> <h3 id="_4-单选题以下代码-输出的结果依次是-选择一项"><a href="#_4-单选题以下代码-输出的结果依次是-选择一项" class="header-anchor">#</a> 4.<strong>单选题</strong>以下代码，输出的结果依次是？（选择一项）</h3> <p><a href="https://imgchr.com/i/BL9irQ" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/11/10/BL9irQ.png" alt="BL9irQ.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**2,3,4</p> <p>**B.**2,2,2</p> <p><strong>C.</strong> 4,4,4</p> <p>**D.**2,2,4</p> <p><strong>本题考查引用类型赋值。</strong></p> <p>引用类型的赋值是把一个对象的内存地址赋值给另一个对象，所以修改其中一个对象的属性值另一个对象的属性也会改变。</p> <p>代码中，b=a之后，a和b指向的地址一样，所以a.num = 2增加了属性num，那么输出b.num也是2。</p> <p>但是注意，a = {num: 3 }是给a重新赋值了一个对象，所以此时a的地址改变了，再修改a的属性，b的属性不会改变。所以后面两次输出b.num依旧是2。</p> <p><strong>本题正确答案为B。</strong></p> <h3 id="_5-多选题选择哪一项补充到代码中-可以让结果输出-5-4-3-2-1-选择两项"><a href="#_5-多选题选择哪一项补充到代码中-可以让结果输出-5-4-3-2-1-选择两项" class="header-anchor">#</a> 5.<strong>多选题</strong>选择哪一项补充到代码中，可以让结果输出[5, 4, 3, 2, 1]？（选择两项）</h3> <p><a href="https://imgchr.com/i/BL9hLQ" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/11/10/BL9hLQ.png" alt="BL9hLQ.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**arr.push(5)，a-b</p> <p>**B.**arr.push(5)，b-a</p> <p>**C.**arr[4]=5,b-a</p> <p>**D.**arr[5]=5,a-b</p> <p><strong>本题考查数组添加元素以及排序的方法。</strong></p> <p>（1）添加数组元素有两种方式，第一种是使用push()方法，即在数组末尾处添加元素，参数是要添加的元素。arr.push(5)意思是在arr末尾处添加元素5。</p> <p>第二种是使用数组索引的方式，把元素添加到指定位置。但是注意，索引从0开始。数组原来有4个元素，如果添加第5个元素，索引应该为4。所以arr[4]=5是正确的。</p> <p>（2）sort()方法用于数组排序，排序规则中，a表示前一个元素，b表示后一个元素。如果a-b或者b-a大于0，则交换元素的位置，如果小于等于0，则不交换。</p> <p>arr前一个元素要比后一个元素小。如果使用a-b，则a-b&lt;0，此时不会交换位置。arr依旧为[1,2,3,4,5]。所以要使用b-a，此时b-a&gt;0,会交换元素的位置，即数值大的会被移动到前面，形成降序排列。</p> <p>所以本题第一处代码可以补充arr.push(5)或者arr[4]=5，第二处代码只能补充b-a，<strong>答案为BC</strong>。</p> <h3 id="_6-单选题观察以下代码-当点击-点击我-时-控制台输出的结果是-选择一项"><a href="#_6-单选题观察以下代码-当点击-点击我-时-控制台输出的结果是-选择一项" class="header-anchor">#</a> 6.<strong>单选题</strong>观察以下代码，当点击“点击我”时，控制台输出的结果是？（选择一项）</h3> <p><a href="https://imgchr.com/i/BLCYwj" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/11/10/BLCYwj.png" alt="BLCYwj.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>A.</strong></p><div>点击我</div><p></p> <p>**B.**点击我</p> <p>**C.**点击我，</p><div>点击我</div><p></p> <p><strong>D.</strong></p><div>点击我</div>，点击我<p></p> <p><strong>本题考查事件以及事件委托相关知识。</strong></p> <p>addEventListener给同一个元素绑定多个相同事件时，不会覆盖，而是按照代码顺序从上往下依次执行。本题代码中，给div.box元素绑定了两个点击事件，所以会输出两个结果。A和B选项只有一个结果，可以先排除。</p> <p>事件委托就是把子元素的事件绑定在父元素上，利用冒泡的原理， 点击子元素时，触发父元素上面的事件。e.target表示触发事件的源对象，即点击了谁，表示的就是谁。这里是点击</p><div>点击我</div>，所以e.target.innerHTML获取的是这个div中的内容，即“点击我”。<p></p> <p>e.currentTarget表示绑定事件的源对象，即不管点击谁，它表示的都是绑定事件的那个元素。本题中，是给div#box绑定的事件，所以e.currentTarget.innerHTML获取的是box元素里面的内容，即</p><div>点击我</div>。<p></p> <p><strong>所以本题答案为C。</strong></p> <h3 id="_7-单选题-结合生活小常识-观察-d-17-0-9x-匹配的是什么-选择一项"><a href="#_7-单选题-结合生活小常识-观察-d-17-0-9x-匹配的是什么-选择一项" class="header-anchor">#</a> 7.**单选题 **结合生活小常识，观察/^\d{17}[0-9X]$/匹配的是什么？（选择一项）</h3> <p>**A.**邮箱</p> <p>**B.**手机号</p> <p><strong>C.</strong> QQ号</p> <p>**D.**身份证</p> <p><strong>本题考查正则表达式的基础知识。</strong></p> <p>\d是匹配数字，{17}是匹配前面的表达式17次，即匹配17个数字。[0-9X]表示匹配0~9的数字或者大写字母X。所以整个表达式匹配的结果有两种，一是18位的数字，而是17位的数字加上一个大写字母X，也是18位。我国居民身份证号码位数是18位，前17位是数字，最后一位可能是数字或者大写X,</p> <p><strong>所以本题答案为D。</strong></p> <h3 id="_8-单选题-某账号密码为字母、数字和下划线的组合-且必须以字母开头-密码长度为6-12位。以下哪一个选项-可以作为此密码的正则-选择一项"><a href="#_8-单选题-某账号密码为字母、数字和下划线的组合-且必须以字母开头-密码长度为6-12位。以下哪一个选项-可以作为此密码的正则-选择一项" class="header-anchor">#</a> 8.<strong>单选题</strong> 某账号密码为字母、数字和下划线的组合，且必须以字母开头，密码长度为6~12位。以下哪一个选项，可以作为此密码的正则？（选择一项）</h3> <p><strong>A.</strong>/^[a-zA-Z]\w{6,12}$/</p> <p><strong>B.</strong>/^[a-zA-Z0-9_]{6,12}$/</p> <p><strong>C.</strong> /^[a-zA-Z]\w{5,11}$/</p> <p><strong>D.</strong>/^[^0-9_][a-zA-Z0-9_]{5,11}$/</p> <p><strong>本题考查正则表达式相关知识。</strong></p> <p>/^[a-zA-Z]\w{6,12}$/：开头的[a-zA-Z]匹配字母，后面的\w{6,12}匹配6~12位的字母，数字、下划线。匹配的总长度为7~13位，长度不符合要求，A错误。</p> <p>/^[a-zA-Z0-9_]{6,12}$/：只匹配了6~12的字母、数字和下划线，没有规定开头必须是字母，B错误。</p> <p>/^[a-zA-Z]\w{5,11}$/：开头的[a-zA-Z]匹配字母，后面的\w{5,11}匹配5~11位的字母，数字、下划线。匹配的总长度为6~12位，符合要求，C正确。</p> <p>/^[^0-9_][a-zA-Z0-9_]{5,11}$/：开头[^0-9_]匹配非数字和下划线，即开头会匹配字母或者其它符号，不符合开头必须字母，D错误。</p> <p><strong>所以本题答案为C。</strong></p> <h3 id="_9-单选题以下代码输出的结果为-选择一项"><a href="#_9-单选题以下代码输出的结果为-选择一项" class="header-anchor">#</a> 9.<strong>单选题</strong>以下代码输出的结果为？（选择一项）</h3> <p><a href="https://imgchr.com/i/BLiLSP" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/11/10/BLiLSP.png" alt="BLiLSP.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**报错</p> <p>**B.**3</p> <p><strong>C.</strong> 4</p> <p>**D.**2</p> <p><strong>本题考查函数参数的使用。</strong></p> <p>定义的形参与实参的位置是一一对应的，即a=6、b=2、c=4，a+b+c计算的结果为12；且调用函数时，传入的实参比形参数量多，不会报错。</p> <p>另外，传入的所有实参，都会保存在arguments类数组中，所以arguments.length获取的参数长度为4。</p> <p>所以result/arguments.length计算结果为12/4=3，<strong>答案为B。</strong></p> <h3 id="_10-单选题观察下面的代码-输出的结果是-选择一项"><a href="#_10-单选题观察下面的代码-输出的结果是-选择一项" class="header-anchor">#</a> 10.<strong>单选题</strong>观察下面的代码，输出的结果是？（选择一项）</h3> <p><a href="https://imgchr.com/i/BLF5cV" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/11/10/BLF5cV.png" alt="BLF5cV.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>A.</strong>[&quot;g&quot;,&quot;o&quot;,&quot;o&quot;,&quot;d&quot;]，object</p> <p><strong>B.</strong>[&quot;d&quot;,&quot;o&quot;,&quot;o&quot;,&quot;g&quot;]，object</p> <p><strong>C.</strong> good, string</p> <p>**D. **doog, string</p> <p><strong>本题考查数组和字符串的一些方法。</strong></p> <p>split() 方法用于把一个字符串分割成字符串数组。</p> <p>reverse() 方法用于反转数组中元素的顺序。</p> <p>join() 方法用于把数组中的所有元素放入一个字符串。</p> <p>本题代码中，str.split(&quot;&quot;)把字符串先分割成数组，即[&quot;g&quot;,&quot;o&quot;,&quot;o&quot;,&quot;d&quot;]，通过reverse()反转数组，即[&quot;d&quot;,&quot;o&quot;,&quot;o&quot;,&quot;g&quot;]。最后再通过join（）方法把数组又转换为字符串，即“doog”。</p> <p>typeof检测字符串类型为string，<strong>所以本题答案为D。</strong></p> <h3 id="_11-单选题观察下面的代码-输出的结果是-选择一项"><a href="#_11-单选题观察下面的代码-输出的结果是-选择一项" class="header-anchor">#</a> 11.<strong>单选题</strong>观察下面的代码，输出的结果是？（选择一项）</h3> <p><a href="https://imgchr.com/i/BLkiAH" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/11/10/BLkiAH.png" alt="BLkiAH.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>A.</strong><a href="https://imgchr.com/i/BLkejf" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/11/10/BLkejf.png" alt="BLkejf.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>B.</strong><a href="https://imgchr.com/i/BLkKHg" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/11/10/BLkKHg.png" alt="BLkKHg.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>C.</strong> <a href="https://imgchr.com/i/BLk8Cn" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/11/10/BLk8Cn.png" alt="BLk8Cn.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>D</strong>.<a href="https://imgchr.com/i/BLkG3q" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/11/10/BLkG3q.png" alt="BLkG3q.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <h3 id="_12-单选题观察一下代码-三次输出的结果依次是-选择一项"><a href="#_12-单选题观察一下代码-三次输出的结果依次是-选择一项" class="header-anchor">#</a> 12.<strong>单选题</strong>观察一下代码，三次输出的结果依次是？（选择一项）</h3> <p><a href="https://imgchr.com/i/BLA2zq" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/11/10/BLA2zq.png" alt="BLA2zq.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>A.</strong>[&quot;g&quot;,&quot;o&quot;,&quot;o&quot;,&quot;d&quot;]，object</p> <p><strong>B.</strong>[&quot;d&quot;,&quot;o&quot;,&quot;o&quot;,&quot;g&quot;]，object</p> <p><strong>C.</strong> good, string</p> <p>**D. **doog, string</p> <p><strong>本题考查作用域和预解析。</strong></p> <p>函数会形成一个局部作用域，局部作用域使用某一个变量时，会先在内部查找并使用。如果没有找到，就会往上一层作用域中查找。另外，变量和函数在代码执行之前会预解析，即会提前定义。但是注意赋值不会预解析，预解析时变量默认赋值为undefined。</p> <p>本题代码中，func中在定义username之前就输出了，不过因为变量预解析，所以函数func中第一次输出结果是“undefined”。第一次输出之后，username会赋值为“小鱼”。</p> <p>函数funcname中没有使用var定义username，它会向上一层作用域func中查找同名的变量username。func中定义了此变量，所以username 的值由&quot;小鱼&quot;修改为“小慕”。第二次输出“小慕”。</p> <p>全局变量并没有修改，所以全局中输出的是“小星星”，<strong>本题答案为D。</strong></p> <h3 id="_13-单选题以下代码输出的结果依次是-选择一项"><a href="#_13-单选题以下代码输出的结果依次是-选择一项" class="header-anchor">#</a> 13.<strong>单选题</strong>以下代码输出的结果依次是？（选择一项）</h3> <p><a href="https://imgchr.com/i/BLEUk4" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/11/10/BLEUk4.png" alt="BLEUk4.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**5,3</p> <p>**B.**5,2</p> <p><strong>C.</strong> 4,3</p> <p>**D. **4,2</p> <p><strong>本题考查预解析和面对对象的基本概念。</strong></p> <p>预解析：使用var声明的变量和function声明的函数会提前定义，但是注意变量赋值并不会预解析。</p> <p>面对对象：实例对象调用某一个方法时，会先在自身查找该方法，如果自身没有此方法，才会去调用原型上的同名方法。</p> <p>本题代码中，先预解析全局的变量“var getNum”和函数“function getNum() {console.log(5) }”。预解析完毕之后，getNum最终的值为function getNum() {console.log(5) }。然后代码执行阶段，变量getNum进行赋值，所以全局下的getNum最终值为function() { console.log(4); }，调用getNum输出结果为4。</p> <p>代码继续往下执行，构造函数Foo实例化，实例对象f自身会继承构造函数内使用”this.”定义的方法getNum，即function() { console.log(2); }。而f的原型会指向构造函数的原型对象，即function() { console.log(3); }。f.getNum()调用同名方法时，优先调用自身的方法，所以结果输出2。</p> <p><strong>本题答案为D。</strong></p> <h3 id="_14-单选题以下代码中-输出的结果依次为-选择一项"><a href="#_14-单选题以下代码中-输出的结果依次为-选择一项" class="header-anchor">#</a> 14.<strong>单选题</strong>以下代码中，输出的结果依次为？（选择一项）</h3> <p><a href="https://imgchr.com/i/BLEOhj" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/11/10/BLEOhj.png" alt="BLEOhj.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**2,2,2,2</p> <p>**B.**1,2,3,4</p> <p><strong>C.</strong> 2,3,2,3</p> <p>**D. **2,3,4,5</p> <p><strong>本题考查闭包和作用域的基本概念。</strong></p> <p>函数里的子函数被函数外部一直使用，使子函数无法释放，保持其所在作用域，形成一个封闭的作用域，称之为闭包。</p> <p>本题代码中，函数out内部返回一个子函数inner。全局变量fn1，fn2的值为函数out的返回值，即子函数inner。由于全局变量在程序执行过程中是不会销毁的，所以它使用的值，即子函数inner无法释放。而inner内部使用的局部变量num，也就随之保存在内存中不会销毁了。</p> <p>第一次调用fn1(),输出2；第二次调用fn1()时，会在内存中拿到上一次num的值并自加，第二次输出为3。需要注意的是，函数out分别调用了两次，即会形成两个不同作用域。每一个作用域中的局部变量不会相互影响。你可以把fn1和fn2看成两个互不干扰的闭包，所以第一次调用fn2()，输出2；第二次调用fn2()，输出3。</p> <p><strong>本题答案为C。</strong></p> <h3 id="_15-单选题有一对小兔子从出生后第三个月起-每一个月都生一对小兔子。生下来的小兔子长到第三个月后-每一个月又生一对小兔子。补充下面的代码-求任意月份兔子的对数-选择一项"><a href="#_15-单选题有一对小兔子从出生后第三个月起-每一个月都生一对小兔子。生下来的小兔子长到第三个月后-每一个月又生一对小兔子。补充下面的代码-求任意月份兔子的对数-选择一项" class="header-anchor">#</a> 15.<strong>单选题</strong>有一对小兔子从出生后第三个月起，每一个月都生一对小兔子。生下来的小兔子长到第三个月后，每一个月又生一对小兔子。补充下面的代码，求任意月份兔子的对数？（选择一项）</h3> <p><a href="https://imgchr.com/i/BLVqr6" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/11/10/BLVqr6.png" alt="BLVqr6.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**func(n - 1) + func(n - 2)</p> <p>**B.**func(n ) + func(n-1)</p> <p><strong>C.</strong> n + func(n - 1)</p> <p>**D. **n + func(n - 2)</p> <p><strong>本题考查递归算法。</strong></p> <p>兔子的对数分析：第一个月1对，第二个月1对，第三个月它们生了1对，共2对。第四个月又生1对，共3对。第五个月，又生了1对，且第二对兔子已经长到第三个月，生了1对小兔子，共5对。第六个月，第一对兔子生了1对，第二对生了1对，第三对兔子已经长到第三个月，也生了一对，共8对。形成的数字规律如下：</p> <p>1，1，2，3，5，8，13，21……（单位：对）</p> <p>以上就是斐波拉契数列，后面的一个数是它前面两个数之和。所以第n个月兔子的对数，为用第n-1个月的兔子对数 + 第n-2个月的兔子对数，即func(n - 1) + func(n - 2)，<strong>本题答案为A。</strong></p> <h3 id="_16-单选题页面上输出99-97-95-93-91-89-87-85-1-也就是1-99的奇数-但是是从大到小的输出-下列哪个循环语句可以实现-选择一项"><a href="#_16-单选题页面上输出99-97-95-93-91-89-87-85-1-也就是1-99的奇数-但是是从大到小的输出-下列哪个循环语句可以实现-选择一项" class="header-anchor">#</a> 16.<strong>单选题</strong>页面上输出99 97 95 93 91 89 87 85………………………………1，也就是1-99的奇数，但是是从大到小的输出，下列哪个循环语句可以实现？（选择一项）</h3> <p>**A.**for(var i=99；i&gt;=1；i=i-2);</p> <p>**B.**for(var i=1；i&lt;100；i=i-2);</p> <p><strong>C.</strong> for(var i=99；i&gt;=1；i++);</p> <p>**D. **for(var i=99；i&gt;=1；i--);</p> <p><strong>参考解析：</strong></p> <p>本题考察的是for循环语句的运用，正确选项为A。</p> <p>从99到1，只取奇数，那么每个数之间是相差2的，循环后的执行语句是i=i-2；数字是倒数，所以要从最大的开始，所以初识变量i=99；</p> <p>倒数最小为1，所以当条件大于等于1时执行循环语句，一旦小于1了，就停止循环。</p> <h3 id="_17-在登录页面中-小云输入的密码是-1234567-小课输入的密码是-12345a-根据以下代码判断页面会输出什么-选择一项"><a href="#_17-在登录页面中-小云输入的密码是-1234567-小课输入的密码是-12345a-根据以下代码判断页面会输出什么-选择一项" class="header-anchor">#</a> 17.在登录页面中，小云输入的密码是：1234567，小课输入的密码是：12345a，根据以下代码判断页面会输出什么？（选择一项）</h3> <p><a href="https://imgchr.com/i/BLZ3ZT" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/11/10/BLZ3ZT.png" alt="BLZ3ZT.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>A.</strong>“ 密码输入正确“   “输入的密码只能为数字”</p> <p><strong>B.</strong>”输入的密码位数不是6位数“  ”密码输入正确“</p> <p><strong>C.</strong> ”输入的密码位数不是6位数“   “输入的密码只能为数字”</p> <p>**D. **控制台报错</p> <p><strong>参考解析：</strong></p> <p>本题考察的是if语句以及isNaN（）的应用，<strong>正确选项为C；</strong></p> <p>小慕输入的密码是7位数，input.length!=6为真，所以会弹出输入的密码位数不是6位数；小课输入的密码是六位数但是包含字母，所以会弹出密码只能为数字。</p> <h3 id="_18-下面代码的运行结果是-选择一项"><a href="#_18-下面代码的运行结果是-选择一项" class="header-anchor">#</a> 18.下面代码的运行结果是？（选择一项）</h3> <p><a href="https://imgchr.com/i/BLZ0L6" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/11/10/BLZ0L6.png" alt="BLZ0L6.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**3</p> <p>**B.**9</p> <p><strong>C.</strong> 4</p> <p>**D. **-1</p> <p><strong>参考解析：</strong></p> <p>本题考察的是字符串的IndexOf（）方法，<strong>正确选项为C</strong>。IndexOf（）方法返回字符串中匹配子串的第一个字符的下标；“Script”首次出现的位置是4。</p> <h3 id="_19-想获取字符串-dreams-will-never-die-中的never字符-substring-里的参数该怎么写-选择一项"><a href="#_19-想获取字符串-dreams-will-never-die-中的never字符-substring-里的参数该怎么写-选择一项" class="header-anchor">#</a> 19.想获取字符串&quot;Dreams will never die&quot;中的never字符，substring（）里的参数该怎么写？（选择一项）</h3> <p>**A.**substring（12,16）</p> <p>**B.**substring（11,17）</p> <p><strong>C.</strong> substring（11,16）</p> <p>**D. **substring（12,17）</p> <p><strong>参考解析：</strong></p> <p>本题考察的是字符串的substring（）方法，<strong>正确选项为D。</strong></p> <p>substring（）方法可以截取字符串中的子字符串，有两个参数，第一个参数是截取的开始位置，第二个参数是截取的结束位置，参数截取含头不含尾。</p> <h3 id="_20-下列代码中-哪个可以实现图片中的效果-控制台每秒打印一次-hello-选择一项"><a href="#_20-下列代码中-哪个可以实现图片中的效果-控制台每秒打印一次-hello-选择一项" class="header-anchor">#</a> 20.下列代码中，哪个可以实现图片中的效果，控制台每秒打印一次“hello”？（选择一项）</h3> <p><a href="https://imgchr.com/i/BLeukD" target="_blank" rel="noopener noreferrer"><img src="https://s1.ax1x.com/2020/11/10/BLeukD.png" alt="BLeukD.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**setInterval ( function( ) { console.log ( &quot;hello&quot; ) ; } , 1000)</p> <p>**B.**setInterval ( function( ) { console.log ( &quot; hello &quot; ) ; } , 1)</p> <p><strong>C.</strong> setTimeout ( function( ) { console.log ( &quot; hello &quot; ) ; } , 1000)</p> <p>**D. **setTimeout ( function( ) { console.log ( &quot; hello &quot; ) ; } , 1)</p> <p><strong>该题考察的是setInterval（）的使用，正确选项为A；</strong></p> <p>setInterval（）方法每隔指定的时间执行一次代码，有两个参数：</p> <p>第一个参数是要执行的函数或者执行脚本</p> <p>第二个参数是周期性执行代码的时间间隔，以毫秒计数</p> <h3 id="回到顶部"><a href="#回到顶部" class="header-anchor">#</a> 回到顶部</h3> <div class="language-js line-numbers-mode"><pre class="language-js"><code>
<span class="token punctuation">(</span><span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">let</span> backToTop <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">getElementById</span><span class="token punctuation">(</span><span class="token string">&quot;backtotop&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

    <span class="token keyword">let</span> timer<span class="token punctuation">;</span>
    <span class="token comment">// 返回顶部按钮的监听</span>
    backToTop<span class="token punctuation">.</span><span class="token function-variable function">onclick</span> <span class="token operator">=</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token comment">// 设表先关</span>
        <span class="token function">clearInterval</span><span class="token punctuation">(</span>timer<span class="token punctuation">)</span><span class="token punctuation">;</span>

        timer <span class="token operator">=</span> <span class="token function">setInterval</span><span class="token punctuation">(</span><span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token comment">// 设置定时器</span>
            document<span class="token punctuation">.</span>documentElement<span class="token punctuation">.</span>scrollTop <span class="token operator">-=</span> <span class="token number">80</span><span class="token punctuation">;</span>

            <span class="token keyword">if</span> <span class="token punctuation">(</span>document<span class="token punctuation">.</span>documentElement<span class="token punctuation">.</span>scrollTop <span class="token operator">&lt;=</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                <span class="token function">clearInterval</span><span class="token punctuation">(</span>timer<span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token number">20</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">;</span>

    <span class="token comment">// 监听页面滚动</span>
    window<span class="token punctuation">.</span><span class="token function-variable function">onscroll</span> <span class="token operator">=</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token comment">// 得到卷动值</span>
        <span class="token keyword">let</span> scrollTop <span class="token operator">=</span> document<span class="token punctuation">.</span>documentElement<span class="token punctuation">.</span>scrollTop <span class="token operator">||</span> window<span class="token punctuation">.</span>scrollY<span class="token punctuation">;</span>

        <span class="token comment">// 如果页面没有卷动  返回顶部隐藏</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span>scrollTop <span class="token operator">===</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            backToTop<span class="token punctuation">.</span>style<span class="token punctuation">.</span>display <span class="token operator">=</span> <span class="token string">&quot;none&quot;</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
            backToTop<span class="token punctuation">.</span>style<span class="token punctuation">.</span>display <span class="token operator">=</span> <span class="token string">&quot;block&quot;</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br></div></div><h3 id="菜单移动"><a href="#菜单移动" class="header-anchor">#</a> 菜单移动</h3> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token punctuation">(</span><span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">let</span> banner_nav_ul <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">getElementById</span><span class="token punctuation">(</span><span class="token string">&quot;banner-nav-ul&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">let</span> menus <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">querySelectorAll</span><span class="token punctuation">(</span><span class="token string">&quot;.menus-box .menu&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">let</span> banner_nav_lis <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">querySelectorAll</span><span class="token punctuation">(</span><span class="token string">&quot;#banner-nav-ul li&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    
    <span class="token keyword">let</span> banner_nav <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">getElementById</span><span class="token punctuation">(</span><span class="token string">&quot;banner-nav&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>


    <span class="token comment">// 事件委托，必须使用onmouseover事件，而不是onmouseenter，我们基础课上讲过，</span>
    <span class="token comment">// onmouseover冒泡，onmouseenter不冒泡</span>
    banner_nav_ul<span class="token punctuation">.</span><span class="token function-variable function">onmouseover</span> <span class="token operator">=</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token parameter">e</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span>e<span class="token punctuation">.</span>target<span class="token punctuation">.</span>tagName<span class="token punctuation">.</span><span class="token function">toLowerCase</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token string">&quot;li&quot;</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token comment">// 得到触碰的这个li元素身上的data-t属性</span>
            <span class="token keyword">let</span> t <span class="token operator">=</span> e<span class="token punctuation">.</span>target<span class="token punctuation">.</span><span class="token function">getAttribute</span><span class="token punctuation">(</span><span class="token string">&quot;data-t&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

            <span class="token comment">//alert(t);</span>

            <span class="token comment">//寻找匹配的menu</span>
            <span class="token keyword">let</span> theMenu <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">querySelector</span><span class="token punctuation">(</span><span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">.menus-box .menu[data-t = </span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>t<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">]</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">)</span><span class="token punctuation">;</span>

            <span class="token comment">//排他操作,让其他的盒子都去掉show类名</span>
            <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> menus<span class="token punctuation">.</span>length<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                menus<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>classList<span class="token punctuation">.</span><span class="token function">remove</span><span class="token punctuation">(</span><span class="token string">&quot;show&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>

            <span class="token comment">// 匹配的这项加上show类名</span>
            theMenu<span class="token punctuation">.</span>classList<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span><span class="token string">&quot;show&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

            <span class="token comment">// 排他操作 , 让所有盒子去掉active类名</span>
            <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> banner_nav_lis<span class="token punctuation">.</span>length<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                <span class="token comment">//banner_nav_lis[i].className = banner_nav_lis[i].getAttribute(&quot;data-t&quot;);</span>
                banner_nav_lis<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>classList<span class="token punctuation">.</span><span class="token function">remove</span><span class="token punctuation">(</span><span class="token string">&quot;active&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>

            <span class="token comment">// 当前触碰匹配到的这项加active类名</span>
            e<span class="token punctuation">.</span>target<span class="token punctuation">.</span>classList<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span><span class="token string">&quot;active&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">;</span>

    <span class="token comment">//  当鼠标离开大盒子的时候 菜单关闭</span>
    banner_nav<span class="token punctuation">.</span><span class="token function-variable function">onmouseleave</span> <span class="token operator">=</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;</span> banner_nav_lis<span class="token punctuation">.</span>length<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token comment">//banner_nav_lis[i].className = banner_nav_lis[i].getAttribute(&quot;data-t&quot;);</span>
            banner_nav_lis<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>classList<span class="token punctuation">.</span><span class="token function">remove</span><span class="token punctuation">(</span><span class="token string">&quot;active&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            menus<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>classList<span class="token punctuation">.</span><span class="token function">remove</span><span class="token punctuation">(</span><span class="token string">&quot;show&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br></div></div><h3 id="无缝轮播图"><a href="#无缝轮播图" class="header-anchor">#</a> 无缝轮播图</h3> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token comment">/* 	轮播图特效

	日期:2020,11,18

	姓名小云

*/</span>

<span class="token punctuation">(</span><span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token comment">// 得到元素</span>
    <span class="token keyword">let</span> carousel_list <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">getElementById</span><span class="token punctuation">(</span><span class="token string">&quot;carousel-list&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">let</span> left_btn <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">getElementById</span><span class="token punctuation">(</span><span class="token string">&quot;left-btn&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">let</span> right_btn <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">getElementById</span><span class="token punctuation">(</span><span class="token string">&quot;right-btn&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">let</span> banner <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">getElementById</span><span class="token punctuation">(</span><span class="token string">&quot;banner&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>


    <span class="token keyword">let</span> circles_ol <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">getElementById</span><span class="token punctuation">(</span><span class="token string">&quot;circles-ol&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">let</span> circles_lis <span class="token operator">=</span> document<span class="token punctuation">.</span><span class="token function">querySelectorAll</span><span class="token punctuation">(</span><span class="token string">&quot;#circles-ol li&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>


    <span class="token comment">// 克隆第一张li</span>
    <span class="token keyword">let</span> clone <span class="token operator">=</span> carousel_list<span class="token punctuation">.</span>firstElementChild<span class="token punctuation">.</span><span class="token function">cloneNode</span><span class="token punctuation">(</span><span class="token boolean">true</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

    <span class="token comment">// 上树</span>
    carousel_list<span class="token punctuation">.</span><span class="token function">appendChild</span><span class="token punctuation">(</span>clone<span class="token punctuation">)</span><span class="token punctuation">;</span>

    <span class="token comment">//当前正在显示的图片序号 从0开始</span>
    <span class="token keyword">let</span> index <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>

    <span class="token comment">//节流锁</span>
    <span class="token keyword">let</span> lock <span class="token operator">=</span> <span class="token boolean">true</span><span class="token punctuation">;</span>

    <span class="token comment">//右按钮的事件监听</span>
    right_btn<span class="token punctuation">.</span>onclick <span class="token operator">=</span> right_btn_handler<span class="token punctuation">;</span>

    <span class="token keyword">function</span> <span class="token function">right_btn_handler</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token comment">// 判断节流所的状态,如果是关闭的,就什么都不做</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">!</span>lock<span class="token punctuation">)</span> <span class="token keyword">return</span><span class="token punctuation">;</span>

        <span class="token comment">// 关锁</span>
        lock <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span>

        <span class="token comment">// 加上过渡</span>
        carousel_list<span class="token punctuation">.</span>style<span class="token punctuation">.</span>transition <span class="token operator">=</span> <span class="token string">&quot;transform .5s ease 0s&quot;</span><span class="token punctuation">;</span>

        <span class="token comment">// idx当然要加1</span>
        index<span class="token operator">++</span><span class="token punctuation">;</span>

        <span class="token comment">// 拉动</span>
        carousel_list<span class="token punctuation">.</span>style<span class="token punctuation">.</span>transform <span class="token operator">=</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">translateX( </span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span><span class="token operator">-</span><span class="token number">16.66</span> <span class="token operator">*</span> index<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">% )</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">;</span>

        <span class="token comment">// 判断是否最后一张 最后一张就瞬间移动回来</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span>index <span class="token operator">&gt;</span> <span class="token number">4</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token function">setTimeout</span><span class="token punctuation">(</span><span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                <span class="token comment">//去掉过渡</span>
                carousel_list<span class="token punctuation">.</span>style<span class="token punctuation">.</span>transition <span class="token operator">=</span> <span class="token string">&quot;none&quot;</span><span class="token punctuation">;</span>
                <span class="token comment">// 删除transform的属性</span>
                carousel_list<span class="token punctuation">.</span>style<span class="token punctuation">.</span>transform <span class="token operator">=</span> <span class="token string">&quot;none&quot;</span><span class="token punctuation">;</span>
                <span class="token comment">// 全局图片的序号变为0</span>
                index <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token number">500</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>

        <span class="token comment">//设置小圆点</span>
        <span class="token function">setCircles</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

        <span class="token comment">// 动画结束之后开锁</span>
        <span class="token function">setTimeout</span><span class="token punctuation">(</span><span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            lock <span class="token operator">=</span> <span class="token boolean">true</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token number">500</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token comment">// 左按钮的事件监听</span>
    left_btn<span class="token punctuation">.</span><span class="token function-variable function">onclick</span> <span class="token operator">=</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token comment">// 判断节流所的状态,如果是关闭的,就什么都不做</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span><span class="token operator">!</span>lock<span class="token punctuation">)</span> <span class="token keyword">return</span><span class="token punctuation">;</span>

        <span class="token comment">// 关锁</span>
        lock <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span>

        <span class="token comment">//左按钮很特殊 先写if语句 而不是index--</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span>index <span class="token operator">==</span> <span class="token number">0</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token comment">// 瞬间拉到最后</span>
            carousel_list<span class="token punctuation">.</span>style<span class="token punctuation">.</span>transition <span class="token operator">=</span> <span class="token string">&quot;none&quot;</span><span class="token punctuation">;</span>

            <span class="token comment">//拉到最后(瞬间移动)</span>
            carousel_list<span class="token punctuation">.</span>style<span class="token punctuation">.</span>transform <span class="token operator">=</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">translateX( </span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span><span class="token operator">-</span><span class="token number">16.66</span> <span class="token operator">*</span> <span class="token number">5</span><span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">% )</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">;</span>

            <span class="token comment">//改变Index的值</span>
            index <span class="token operator">=</span> <span class="token number">4</span><span class="token punctuation">;</span>

            <span class="token comment">//小技巧 延时0毫秒非常有用 可以让刚刚的瞬移发生后 再把过渡加上</span>
            <span class="token function">setTimeout</span><span class="token punctuation">(</span><span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                <span class="token comment">// 加上过渡</span>
                carousel_list<span class="token punctuation">.</span>style<span class="token punctuation">.</span>transition <span class="token operator">=</span> <span class="token string">&quot;transform .5s ease 0s&quot;</span><span class="token punctuation">;</span>

                <span class="token comment">// 动画</span>
                carousel_list<span class="token punctuation">.</span>style<span class="token punctuation">.</span>transform <span class="token operator">=</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">translateX( </span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span><span class="token operator">-</span><span class="token number">16.66</span> <span class="token operator">*</span> <span class="token number">4</span><span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">% )</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
            index<span class="token operator">--</span><span class="token punctuation">;</span>
            <span class="token comment">//拉动</span>
            carousel_list<span class="token punctuation">.</span>style<span class="token punctuation">.</span>transform <span class="token operator">=</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">translateX( </span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span><span class="token operator">-</span><span class="token number">16.66</span> <span class="token operator">*</span> index<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">% )</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>

        <span class="token comment">//设置小圆点</span>
        <span class="token function">setCircles</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

        <span class="token comment">// 动画结束之后开锁</span>
        <span class="token function">setTimeout</span><span class="token punctuation">(</span><span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            lock <span class="token operator">=</span> <span class="token boolean">true</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token number">500</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">;</span>

    <span class="token comment">// 设置小圆点的active在谁身上 序号为index小圆点才有active类名 其他li没有</span>
    <span class="token keyword">function</span> <span class="token function">setCircles</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">;</span> i <span class="token operator">&lt;=</span> <span class="token number">4</span><span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token comment">//i == index 当index=5的时候也是第一张图片但是没变 可以 i == index % 5</span>
            <span class="token comment">// 这里的 %5 非常巧妙 1,2,3,4除以5的余数是它本身 但是5除以5就等于0了</span>
            <span class="token comment">//这里的 %5 的目的就是为了右按钮它有一瞬间 Index = 5 500毫秒才会变为0</span>

            <span class="token keyword">if</span> <span class="token punctuation">(</span>i <span class="token operator">==</span> index <span class="token operator">%</span> <span class="token number">5</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
                circles_lis<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>classList<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span><span class="token string">&quot;active&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span> <span class="token keyword">else</span> <span class="token punctuation">{</span>
                circles_lis<span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">.</span>classList<span class="token punctuation">.</span><span class="token function">remove</span><span class="token punctuation">(</span><span class="token string">&quot;active&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>

    <span class="token comment">//   事件委托 小圆点的监听</span>
    circles_ol<span class="token punctuation">.</span><span class="token function-variable function">onclick</span> <span class="token operator">=</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token parameter">e</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">if</span> <span class="token punctuation">(</span>e<span class="token punctuation">.</span>target<span class="token punctuation">.</span>tagName<span class="token punctuation">.</span><span class="token function">toLowerCase</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token string">&quot;li&quot;</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
            <span class="token comment">// 得到li身上的data-n属性，就是n</span>
            <span class="token keyword">let</span> n <span class="token operator">=</span> <span class="token function">Number</span><span class="token punctuation">(</span>e<span class="token punctuation">.</span>target<span class="token punctuation">.</span><span class="token function">getAttribute</span><span class="token punctuation">(</span><span class="token string">&quot;data-n&quot;</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token comment">// 改变idx</span>
            index <span class="token operator">=</span> n<span class="token punctuation">;</span>
            <span class="token comment">//拉动</span>
            carousel_list<span class="token punctuation">.</span>style<span class="token punctuation">.</span>transform <span class="token operator">=</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">translateX( </span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span><span class="token operator">-</span><span class="token number">16.66</span> <span class="token operator">*</span> index<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">% )</span><span class="token template-punctuation string">`</span></span><span class="token punctuation">;</span>

            <span class="token comment">//设置小圆点</span>
            <span class="token function">setCircles</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">;</span>

    <span class="token comment">// 定时器 自动轮播</span>
    <span class="token keyword">let</span> timer <span class="token operator">=</span> <span class="token function">setInterval</span><span class="token punctuation">(</span>right_btn_handler<span class="token punctuation">,</span> <span class="token number">2000</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

    <span class="token comment">// 鼠标进入,自动轮播暂停</span>
    banner<span class="token punctuation">.</span><span class="token function-variable function">onmouseenter</span> <span class="token operator">=</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token function">clearInterval</span><span class="token punctuation">(</span>timer<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">;</span>

    <span class="token comment">// 鼠标进入,自动轮播开始</span>
    banner<span class="token punctuation">.</span><span class="token function-variable function">onmouseleave</span> <span class="token operator">=</span> <span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token comment">// 设表先关</span>
        <span class="token function">clearInterval</span><span class="token punctuation">(</span>timer<span class="token punctuation">)</span><span class="token punctuation">;</span>

        <span class="token comment">// 设置定时器 这里不要加let 加let就声明局部变量了,就clear不掉了!</span>
        timer <span class="token operator">=</span> <span class="token function">setInterval</span><span class="token punctuation">(</span>right_btn_handler<span class="token punctuation">,</span> <span class="token number">2000</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br><span class="line-number">8</span><br><span class="line-number">9</span><br><span class="line-number">10</span><br><span class="line-number">11</span><br><span class="line-number">12</span><br><span class="line-number">13</span><br><span class="line-number">14</span><br><span class="line-number">15</span><br><span class="line-number">16</span><br><span class="line-number">17</span><br><span class="line-number">18</span><br><span class="line-number">19</span><br><span class="line-number">20</span><br><span class="line-number">21</span><br><span class="line-number">22</span><br><span class="line-number">23</span><br><span class="line-number">24</span><br><span class="line-number">25</span><br><span class="line-number">26</span><br><span class="line-number">27</span><br><span class="line-number">28</span><br><span class="line-number">29</span><br><span class="line-number">30</span><br><span class="line-number">31</span><br><span class="line-number">32</span><br><span class="line-number">33</span><br><span class="line-number">34</span><br><span class="line-number">35</span><br><span class="line-number">36</span><br><span class="line-number">37</span><br><span class="line-number">38</span><br><span class="line-number">39</span><br><span class="line-number">40</span><br><span class="line-number">41</span><br><span class="line-number">42</span><br><span class="line-number">43</span><br><span class="line-number">44</span><br><span class="line-number">45</span><br><span class="line-number">46</span><br><span class="line-number">47</span><br><span class="line-number">48</span><br><span class="line-number">49</span><br><span class="line-number">50</span><br><span class="line-number">51</span><br><span class="line-number">52</span><br><span class="line-number">53</span><br><span class="line-number">54</span><br><span class="line-number">55</span><br><span class="line-number">56</span><br><span class="line-number">57</span><br><span class="line-number">58</span><br><span class="line-number">59</span><br><span class="line-number">60</span><br><span class="line-number">61</span><br><span class="line-number">62</span><br><span class="line-number">63</span><br><span class="line-number">64</span><br><span class="line-number">65</span><br><span class="line-number">66</span><br><span class="line-number">67</span><br><span class="line-number">68</span><br><span class="line-number">69</span><br><span class="line-number">70</span><br><span class="line-number">71</span><br><span class="line-number">72</span><br><span class="line-number">73</span><br><span class="line-number">74</span><br><span class="line-number">75</span><br><span class="line-number">76</span><br><span class="line-number">77</span><br><span class="line-number">78</span><br><span class="line-number">79</span><br><span class="line-number">80</span><br><span class="line-number">81</span><br><span class="line-number">82</span><br><span class="line-number">83</span><br><span class="line-number">84</span><br><span class="line-number">85</span><br><span class="line-number">86</span><br><span class="line-number">87</span><br><span class="line-number">88</span><br><span class="line-number">89</span><br><span class="line-number">90</span><br><span class="line-number">91</span><br><span class="line-number">92</span><br><span class="line-number">93</span><br><span class="line-number">94</span><br><span class="line-number">95</span><br><span class="line-number">96</span><br><span class="line-number">97</span><br><span class="line-number">98</span><br><span class="line-number">99</span><br><span class="line-number">100</span><br><span class="line-number">101</span><br><span class="line-number">102</span><br><span class="line-number">103</span><br><span class="line-number">104</span><br><span class="line-number">105</span><br><span class="line-number">106</span><br><span class="line-number">107</span><br><span class="line-number">108</span><br><span class="line-number">109</span><br><span class="line-number">110</span><br><span class="line-number">111</span><br><span class="line-number">112</span><br><span class="line-number">113</span><br><span class="line-number">114</span><br><span class="line-number">115</span><br><span class="line-number">116</span><br><span class="line-number">117</span><br><span class="line-number">118</span><br><span class="line-number">119</span><br><span class="line-number">120</span><br><span class="line-number">121</span><br><span class="line-number">122</span><br><span class="line-number">123</span><br><span class="line-number">124</span><br><span class="line-number">125</span><br><span class="line-number">126</span><br><span class="line-number">127</span><br><span class="line-number">128</span><br><span class="line-number">129</span><br><span class="line-number">130</span><br><span class="line-number">131</span><br><span class="line-number">132</span><br><span class="line-number">133</span><br><span class="line-number">134</span><br><span class="line-number">135</span><br><span class="line-number">136</span><br><span class="line-number">137</span><br><span class="line-number">138</span><br><span class="line-number">139</span><br><span class="line-number">140</span><br><span class="line-number">141</span><br><span class="line-number">142</span><br><span class="line-number">143</span><br><span class="line-number">144</span><br><span class="line-number">145</span><br><span class="line-number">146</span><br><span class="line-number">147</span><br><span class="line-number">148</span><br><span class="line-number">149</span><br><span class="line-number">150</span><br><span class="line-number">151</span><br><span class="line-number">152</span><br><span class="line-number">153</span><br><span class="line-number">154</span><br><span class="line-number">155</span><br><span class="line-number">156</span><br><span class="line-number">157</span><br><span class="line-number">158</span><br><span class="line-number">159</span><br><span class="line-number">160</span><br><span class="line-number">161</span><br><span class="line-number">162</span><br></div></div></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/./guide/notes/jswork/14-面向project.html" class="prev">
        14-面向对象
      </a></span> <span class="next"><a href="/./guide/notes/jswork/16-模板字符串箭头函数变量声明.html">
        16-模板字符串箭头函数变量声明
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"><!----><div class="reco-bgm-panel" data-v-b1d3339e><audio id="bgm" src="https://www.ytmp3.cn/down/75475.mp3" data-v-b1d3339e></audio> <div class="reco-float-box" style="bottom:30px;z-index:999999;display:none;" data-v-b1d3339e data-v-41bcba48 data-v-b1d3339e><img src="https://p1.music.126.net/qTSIZ27qiFvRoKj-P30BiA==/109951165895951287.jpg?param=200y200" data-v-b1d3339e></div> <div class="reco-bgm-box" style="left:10px;bottom:10px;z-index:999999;" data-v-b1d3339e data-v-41bcba48 data-v-b1d3339e><div class="reco-bgm-cover" style="background-image:url(https://p1.music.126.net/qTSIZ27qiFvRoKj-P30BiA==/109951165895951287.jpg?param=200y200);" data-v-b1d3339e><div class="mini-operation" style="display:none;" data-v-b1d3339e><i class="reco-bgm reco-bgm-pause" style="display:none;" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-play" style="display:none;" data-v-b1d3339e></i></div> <div class="falut-message" style="display:none;" data-v-b1d3339e>
          播放失败
        </div></div> <div class="reco-bgm-info" data-v-b1d3339e data-v-41bcba48 data-v-b1d3339e><div class="info-box" data-v-b1d3339e><i class="reco-bgm reco-bgm-music music" data-v-b1d3339e></i>花花公子</div> <div class="info-box" data-v-b1d3339e><i class="reco-bgm reco-bgm-artist" data-v-b1d3339e></i>马思唯/step.jad</div> <div class="reco-bgm-progress" data-v-b1d3339e><div class="progress-bar" data-v-b1d3339e><div class="bar" data-v-b1d3339e></div></div></div> <div class="reco-bgm-operation" data-v-b1d3339e><i class="reco-bgm reco-bgm-last last" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-pause pause" style="display:none;" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-play play" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-next next" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-volume1 volume" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-mute mute" style="display:none;" data-v-b1d3339e></i> <div class="volume-bar" data-v-b1d3339e><div class="bar" data-v-b1d3339e></div></div></div></div> <div class="reco-bgm-left-box" data-v-b1d3339e data-v-41bcba48 data-v-b1d3339e><i class="reco-bgm reco-bgm-left" data-v-b1d3339e></i></div></div></div></div></div>
    <script src="./assets/js/app.7878252f.js" defer></script><script src="./assets/js/2.877879cc.js" defer></script><script src="./assets/js/85.96bc7e77.js" defer></script>
  </body>
</html>
